<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
    
     <div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="formId">
					<div class="select-list">
						<ul>
							<li>
								电梯名称：<input type="text" name="elevatorName"/>
							</li>
							<li>
								上报类别：
								<select name="reportType">
									<option value="">所有</option>
									<option value="0">人工上报</option>
									<option value="1">智能设备</option>
									<option value="2">微信上报</option>
								</select>
							</li>
							<!--<li>
								提交人：<input type="text" name="submitter"/>
							</li>
							<li class="select-time">
								<span>提交时间：</span>
								<input type="text" style="width: 280px" class="time-input" id="startTime" name="submitDate"/>
							</li>-->
							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('business:elevatorRepair:edit')}]];
        var removeFlag = [[${@permission.hasPermi('business:elevatorRepair:remove')}]];
        var prefix = ctx + "business/elevatorRepair";

        $(function() {
            var options = {
                url: prefix + "/list?reviewType=2",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
				exportUrl: prefix + "/export",
                modalName: "电梯维修",
				search: false,
		        showExport: true,
                columns: [{
					radio: true
		        },
				{
					field : 'repairId', 
					title : '维修ID',
					visible: false
				},
				{
					title: "序号",
					formatter: function (value, row, index) {
						return $.table.serialNumber(index);
					}
				},
				{
					field : 'elevatorId', 
					title : '关联电梯ID',
					visible: false
				},
				{
					field : 'repairCode',
					title : '维修单号'
				},
				{
					field: 'elevatorName',
					title: '电梯名称',
					formatter: function (value, row, index) {
						return addClick(value,row);
					}
				},
				{
					field: 'reportType',
					title: '上报类别',
					formatter:function (value, row, index) {
						if (value == 0){
							return "人工上报"
						} else if (value == 1){
							return "智能设备"
						} else if (value == 1){
							return "微信上报"
						}
					}
				},
				{
					field : 'dispatchPeople', 
					title : '派单人'
				},
				{
					field : 'dispatchDate', 
					title : '派单时间',
					sortable: true
				},
				{
					field : 'submitter', 
					title : '提交人'
				},
				{
					field : 'submitDate', 
					title : '提交时间',
					sortable: true
				},
				{
					field : 'repairHours', 
					title : '维修用时'
				}]
            };
            $.table.init(options);
        });

		function addClick(value, row) {
			return '<a href="javascript:void(0)" onclick="enable(\'' + row.repairId + '\')">' + value + '</a>'
		}

		function enable(repairId) {
			createMenuItem(prefix+"/elevatorConfirmInfo/" + repairId, "维修信息")
		}
    </script>
</body>
</html>